import { request } from "@/api/auth";

export const createGroup = (data: {}) => {
    return request.post("/group/create", data)
}

export const updateGroup = (group_id: number, data: {}) => {
    return request.put(`/group/${group_id}/update`, data)
}

export const deleteGroup = (group_id: number) => {
    return request.delete(`/group/${group_id}/delete`)
}

export const listGroup = (query: {}) => {
    return request.get("/group/list", { params: query })
}

export const bindUser = (data: {}) => {
    return request.post("/group/binduser", data)
}

export const listBindUser = (id: number, query: {}) => {
    return request.get(`/group/${id}/binduser/list`, { params: query })
}

export const bindRole = (data: {}) => {
    return request.post("/group/bindrole", data)
}
export const listBindRole = (id: number, query: {}) => {
    return request.get(`/group/${id}/bindrole/list`, { params: query })
}